package com.example.yadmin.sys.service.impl;

import com.example.yadmin.sys.entity.Chat;
import com.example.yadmin.sys.mapper.ChatMapper;
import com.example.yadmin.sys.service.IChatService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ag
 * @since 2023-11-04
 */
@Service
public class ChatServiceImpl extends ServiceImpl<ChatMapper, Chat> implements IChatService {

    @Override
    public void addChat(Chat chat) {
        this.baseMapper.insert(chat);
    }

    @Override
    public void updateChat(Chat chat) {
        this.baseMapper.updateById(chat);
    }

    @Override
    public Chat getChatById(Integer id) {
        Chat chat = this.baseMapper.selectById(id);
        return chat;
    }

    @Override
    public void deleteChatById(Integer id) {
        this.baseMapper.deleteById(id);
    }



}
